home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.5 Applications 1998 June / SGI IRIX 6.5 Applications 1998 June.iso / dist / outbox.idb / var / www / cgi-bin / MachineInfo.z / MachineInfo
Text File  |  1998-05-04  |  2KB  |  75 lines

  1. #!/usr/bin/perl
  2.  
  3. #__________________________________________________________
  4. #
  5. #   File:    MachineInfo
  6. #   By:      Matt Ho
  7. #   Date:    7/23/95
  8. #   Purpose: Display host configuration
  9. #__________________________________________________________
  10.  
  11. $hostname = `/usr/bsd/hostname -s` ;
  12. open(DATA, "/sbin/hinv |") || &CantGetInfo ;
  13.  
  14. print <<ENDOFTEXT ;
  15. Content-type: text/html
  16. Pragma: no-cache
  17.  
  18. <head>
  19.     <title>
  20.         $hostname
  21.     </title>
  22. </head>
  23.  
  24. <body alink="ff0000" vlink="0000ee" link="0000ee" background="/outbox/images/background.gif" bgcolor="c1c1c1" text="000000">
  25.  
  26. <TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0><TR>
  27. <TD ALIGN=LEFT VALIGN=TOP><IMG SRC="/outbox/images/logo.gif" ALT="Powered by Silicon Graphics"></TD>
  28. <TD ALIGN=RIGHT VALIGN=TOP><TABLE CELLPADDING=0 CELLSPACING=0>
  29. <TR>
  30. <TD ALIGN=CENTER><A HREF="/" onMouseOver="window.status=\'Go to the system\\\'s web page\';return true" ><IMG SRC="/outbox/images/machine.gif" WIDTH=34 HEIGHT=32 ALT="System"></A></TD>
  31. <TR>
  32. <TD ALIGN=CENTER><FONT SIZE=-2>System</FONT></TD>
  33. </TABLE></TD>
  34. </TABLE>
  35. <P><BR>
  36.  
  37. <h1 align=center>$hostname</h1>
  38. <center>
  39. <hr size=3 noshade width=50%>
  40. <table>
  41. ENDOFTEXT
  42.  
  43. while( <DATA> )
  44. {
  45.     ($name, $value) = split(':', $_, 2) ;
  46.     print <<ENDOFTEXT ;
  47. <tr>
  48.     <th align=right>
  49.         $name
  50.     </th>
  51.     <td>
  52.         $value
  53.     </td>
  54. </tr>
  55. ENDOFTEXT
  56. }
  57. close(DATA) ;
  58.  
  59. print <<ENDOFTEXT ;
  60. </table>
  61. <hr size=3 noshade width=50%>
  62. </center>
  63. ENDOFTEXT
  64.  
  65. if( defined $ENV{'HTTP_REFERER'} )
  66. {
  67.     $URL = $ENV{'HTTP_REFERER'} ;
  68.     print <<ENDOFTEXT ;
  69. <a href="$URL"><IMG SRC="/outbox/images/go-back.gif" WIDTH=34 HEIGHT=32 BORDER=0 ALT="<-"></A>
  70. ENDOFTEXT
  71. }
  72.  
  73. print "\n</body></html>\n\n" ;
  74.  
  75.